Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cell value in straight table

I have a raw data like below table and need below data, could you please show me how to do it. Many thanks

First,  top2 AMT from MAX(Date) => 500000 and 70000

Second,  "Device Name" of top2 AMT => TT and BB

Third,  difference AMT between MAX(Date) and MAX(Date)-1

It should be :

500000 ,   TT      , 493990 (500000-6010)

70000   ,    BB    , 70000 (70000-0)

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Like this:

2018-04-03 19_13_22-#QC 2018-04-02 Cell value in straight table - My new sheet _ App overview - Qlik.png

The expression for AMT is:

Sum( {<R#={"=Rank( Sum({<Date={'$(=Date(Max(Date)))'}>} AMT))<=2"}>} AMT )

NOTE: the R# is a field which is created in the load script in this way:

LOAD

       RowNo() AS R#,

       "Device Name",

      .....

......;

The expression for AMT1-AMT2:

Column(1)- Sum( {1<Date={'$(=Date(Max(Date)-1))'},[Device Name]=P({<R#={"=Rank( Sum({<Date={'$(=Date(Max(Date)))'}>} AMT))<=2"}>})>} AMT )

( Column(1) could be replace by the full expression for AMT or even replaced with just AMT )

View solution in original post

2 Replies
petter
Partner - Champion III
Partner - Champion III

Like this:

2018-04-03 19_13_22-#QC 2018-04-02 Cell value in straight table - My new sheet _ App overview - Qlik.png

The expression for AMT is:

Sum( {<R#={"=Rank( Sum({<Date={'$(=Date(Max(Date)))'}>} AMT))<=2"}>} AMT )

NOTE: the R# is a field which is created in the load script in this way:

LOAD

       RowNo() AS R#,

       "Device Name",

      .....

......;

The expression for AMT1-AMT2:

Column(1)- Sum( {1<Date={'$(=Date(Max(Date)-1))'},[Device Name]=P({<R#={"=Rank( Sum({<Date={'$(=Date(Max(Date)))'}>} AMT))<=2"}>})>} AMT )

( Column(1) could be replace by the full expression for AMT or even replaced with just AMT )

petter
Partner - Champion III
Partner - Champion III

Please mark the response as answered if this answered your question.