Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to avoid if condition in Dashboard

Hi..

I have formula like =count({$<DISPOSITION={"XA"}>} if(LASTMENUACCESSED=MENUID,MENUID,null()) ) in dash board..

but i have to avoid if(LASTMENUACCESSED=MENUID,MENUID,null()) in dashboard.

Please help me..

please find following attachment..

Thanks,

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this in script

IVRREPORTDATA_CALLINFO:

LOAD
*
FROM IVRREPORTDATA_CALLINFO;

Temp:
LOAD
*
FROM IVRReportdata_Menu;

LEFT JOIN(Temp)
LOAD
SessionID,
LASTMENUACCESSED AS TempField
RESIDENT IVRREPORTDATA_CALLINFO;

IVRReportdata_Menu:
LOAD
*,
If(MENUID = TempField, 1, 0) AS Flag
RESIDENT Temp;

DROP TABLE Temp;
DROP FIELD TempField;

Now in chart just use

Count({<Flag = {1}>} DISTINCT MENUID)

OR

Count({<Flag = {1}>} MENUID)

Hope this helps you.

Regards,

Jagan.

View solution in original post

25 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Is LASTMENUACCESSED, MENUID are in the same table?  Then try like this

LOAD

*,

If(LASTMENUACCESSED=MENUID, 1, 0) AS Flag

FROM DataSource;


Now use below expression


=count({$<DISPOSITION={"XA"}, Flag={1}>} MENUID)


Hope this helps you.


Regards,

Jagan.

Anonymous
Not applicable
Author

Hi..

Jagan Thanks for your reply..

Menuid and lastmenuaccessed are in Different tables...

Thanks..

amit_saini
Master III
Master III

Chandini,

Check this:

Re: how to avoid nested if

Thanks,
AS

jagan
Luminary Alumni
Luminary Alumni

Hi,

If possible bring both this columns into same table and arrive the flag?

Regards,

Jagan.

Anonymous
Not applicable
Author

Hi jagan..

What my exact need is my formula is

=count({$<DISPOSITION={"XA"}>} if(LASTMENUACCESSED=MENUID,MENUID,null()) )

in this if(LASTMENUACCESSED=MENUID,MENUID,null()) .i have to avoid if condition statement into  set analysis formula..

means entire formula contains only set analysis formulas not if conditions..

please help me...

Thanks..

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

Try below expression. you can avoid if  condition through p() function.

=count({$<DISPOSITION={"XA"},MENUID=p(LASTMENUACCESSED)>} MENUID)

sujeetsingh
Master III
Master III

Chandani,

Better you follow the concept of Flag suggested by Jagan.

Derieve Flag for the conditions in script and then call them in UI where needed.

Anonymous
Not applicable
Author

Hi Jagan..

Can you help me entire formula to set analysis related formula..

THAMKS,

jagan
Luminary Alumni
Luminary Alumni

Hi,

Attach some sample file then it would be easier to give solution.

Regards,

Jagan.