Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

if statment

Hello everyone,

I hope all is well.

Bellow is the result of a sql query in qlikview :

     kpi                                          sum(revenue)

Capture.JPG

My objective first to divise the sum(revenue) by 1000 whene kpi='Recharged'

and then to gather data revenue stc and data revenu with recharged   / Others Revenue + Oterhrs Revenue => Other Revenu

the result would be like this :

recharged       1255

other revenue  545

outgoing call revenue 245

outgoing sms revenue 544

Thanks

4 Replies
sunny_talwar

Not sure what you are looking to get. What are the numbers behind your expected result?

Anonymous
Not applicable

First:

if(kpi = 'Recharged',

     sum(revenue) / 1000)


The second part I did not understand.

master_student
Creator III
Creator III
Author

if kpi =data revenue or kpi = data revenue stc then kpi =Recharged

recharged = sum(kpi='recharged',revenue)/1000+sum(kpi='data revenue', revenue)+sum(kpi='data revenue stc', revenue)

and also : if kpi =othres revenue or kpi = otehrs then kpi =other revenu

Anonymous
Not applicable

In script do

if(kpi = 'DATA Revenue' or kpi = 'DATA Revenue stc', 'Recharged',

     if (kpi = 'Othres Revenue' or kpi = 'Otehrs Revenue', 'Other Revenu',

          kpi)) as New_Kpi


The rest do in expression.