Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Avarage value in straight table is not working

Hi

I ahve scenario,

I need to show records of latest month in straight table.

In that i need show trend of last 6 months and 3 months based on user selection of rate column.

I am not bale to show trend of last 3,6 months ,Please guide me for that.

Please do the needful

16 Replies
sunny_talwar

May be one of the two expression, with just Country as dimension

Dimension

Country

Expression

1) =Sum({<YearMonth={"$(=Date(MakeDate(2017, 4, 25), 'YYYY/MM/DD'))"}>} Sales)

2)

    Option 1

    =AVG({<YearMonth={"$(='>=' & Date(AddMonths(Date(V_DB_Max_date),-(Value-1)), 'YYYY/MM/DD') & '<=' & Date(V_DB_Max_date, 'YYYY/MM/DD'))"}>} Rate)/100

    Option 2

    =AVG({<YearMonth={"$(='>=' & Date(AddMonths(Date(V_DB_Max_date),-(Value-1)), 'YYYY/MM/DD') & '<=' & Date(V_DB_Max_date, 'YYYY/MM/DD'))"}, Rate = {'>0'}>} Rate)/100

Not applicable
Author

Hi Sunny,

I got it .

Can you please change this syntax

Sum({<YearMonth={"$(=Date(MakeDate(2017, 4, 25), 'YYYY/MM/DD'))"}>} Sales) to

Sum({<YearMonth={"$(=Date(V_DB_Max_date)))"}>} Sales)

Thanks

Thiru

sunny_talwar

May be this

Sum({<YearMonth={"$(=Date(V_DB_Max_date, 'YYYY/MM/DD'))"}>} Sales)

Not applicable
Author

Hi Sunny,

Thank you so much.

Regards

Thiru

Not applicable
Author

Hi Sunny,

A small qs

if it is number we are using set analysis which is working fine.

I want show a comment for latest month.

How to get the text using set analysis?

Please do the needful

Regards

Thiru

sunny_talwar

May be using Only({<SetAnalysis}>} Comment)

Not applicable
Author

Hi Sunny,

I have done Changes  in script level like

LOAD *,

           if(yearMonth=$(V_DB_Max_date),comment,' ') as comment resident table.

It is working thanks for your solution.

Regards

Thiru