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: 
yogitamehta10
Creator
Creator

Quarter and month analysis

Hi  All,

i have a problem ,i have month and quarter anlaysis  in  Qliksense dashbaord,

by defulat i have to show current month data in KPI Chart, but when  i select quarter or month it should  show data  accordingly ,

but problem is  when i'm selecting quarter it is showing data of latest month not quarter , because of the latest month expression in set anlaysis .

my exression is :

count({<REF_NO={'a'},STATUS={'C'},Year={$(=max(Year))},

[MONTH] ={$(=max([ MONTH]))}>}NOM)

when i 'm removing this [Calender MONTH] ={$(=max([Calender MONTH]))}, then  quarter analysis is fine but then i can not show current month data by defualt.

could you please help?

9 Replies
sunny_talwar

May be try like this:

If(GetSelectedCount(Quarter) > 0,

Count({<REF_NO={'a'}, STATUS={'C'}, Year={$(=max(Year))}>}NOM),

Count({<REF_NO={'a'}, STATUS={'C'}, Year={$(=max(Year))}, [MONTH] ={$(=max([ MONTH]))}>}NOM))

yogitamehta10
Creator
Creator
Author

Thanks, but my condition is little comlicated , when i'm selecting a quarter , it should meet a condition , that flag should be 1 after selcting the quarter , because it will impact the data.

so there are two tables , one is calender another one is fact that has  flag 1,0.

so i want to show quarter data when  flag is 1.

sunny_talwar

I can only give you a generic solution if you share a generic description . For a more detailed response, I think it would be helpful if you can share a sample with the expected output.

Best,

Sunny

yogitamehta10
Creator
Creator
Author

just wanted to know should i give flag in filter of quarter , if i'm giving if condition in filetr then it started showing wrong data for quarter.

sunny_talwar

Can you share the expression you are hoping to use? I am not sure I understand what you are wanting to do from your description

yogitamehta10
Creator
Creator
Author

if(LATEST=1,Quarter)

yogitamehta10
Creator
Creator
Author

My logic should be when i use Quarter  to anakyze the data , then is latest flag should go to one by defulat , this is just to avoid multiple records in data .  if i have 4 entries of same number , but  latest flag will go 1 for one out of three,

sunny_talwar

Still not 100% sure, but may be this:

If(GetSelectedCount(Quarter) > 0,

Count({<REF_NO={'a'}, STATUS={'C'}, Year={$(=max(Year))}, LATEST = {1}>}NOM),

Count({<REF_NO={'a'}, STATUS={'C'}, Year={$(=max(Year))}, [MONTH] ={$(=max([ MONTH]))}>}NOM))

yogitamehta10
Creator
Creator
Author

thanks, i will try this way.