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: 
Not applicable

Expressions values to store in variable

Hi All,

I need help...

I have a table with 2 fields – Count1, Date1.

I have 2 expressions which will give me Month & Year based on some other logic. Through this Month & Year I need to show in my text box as below:

Sum of monthly Count1 / Sum of Total records Count1 * 100 & ‘%’

Here is my expressions to get Month:

=IF(GetSelectedCount([Date]) > 0 ,Month([Date]),
IF(GetSelectedCount(Year) = 0 and GetSelectedCount(Month) = 0, Month(Today()),
IF(GetSelectedCount(Year) > 0 and GetSelectedCount(Year) = Year(Today()), Month(Today()),
IF(GetSelectedCount(Year) > 0 and GetSelectedCount(Year) < Year(Today()), SubField('$(MonthNames)',';',Max(Month))))))

To Get Year:

=IF(GetSelectedCount([Date]) > 0 ,Year([Date]),
IF(GetFieldSelections(Year)<Year(Today()),Year,Year(Today())))

Thanks,

Lakshmi.

12 Replies
MK_QSL
MVP
MVP

In your expression, Year is remaining same, so it will give you result like

Jan 2014, Dec 2014, Nov 2014, Oct 2014.... Correct me if I am wrong...

Not applicable
Author

Hi Manish,

It seems Year will be wrong. I didn't think about year changes. the correct way is Jan 2014, Dec 2013, Nov 2013 and Oct 2013.

How to achive it? I am very new to this. pls help.

Thanks,

Lakshmi.

Not applicable
Author

Hi Anbu,

can you pls help?

It seems Year will be wrong. I didn't think about year changes. the correct way is Jan 2014, Dec 2013, Nov 2013 and Oct 2013.

How to achive it? I am very new to this. pls help.

Thanks,

Lakshmi.