Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
padmanabhan_ram
Creator II
Creator II

Expression to find the next minimum value

Hi All,

I have a below table

MonthNoProductSales
Jan-13A12

Feb-13

A45
Mar-13A76
April-13A34
Feb-13B98
Mar-13B54
Apr-13B65

I am storing the Minimum MonthNo value in a 'vMonthNo' variable.

When I do "if(MonthName_Vol_Chart =vMonthNo,Sales,'') to get the Sale value for starting month.

I get the value for Product A as 12 but I do not get any value against Product B and I understand that it's because there no value for product B.

How can I make the expression flexible enough to get the values for the product B.

Note: There can be many Products like B which might have the same behaviour.

Thanks in advance,

Padmanabhan

15 Replies
padmanabhan_ram
Creator II
Creator II
Author

Hi,

Thanks for your response, but it didn't work.

I have attached the qvw for your reference.

Regards,

Padmanabhan

tresesco
MVP
MVP

PFA

You have to convert the Date field into a proper qv date field(numeric at the backend)

padmanabhan_ram
Creator II
Creator II
Author

Hi Tresesco,

When I try to transform it to Line graph, data doesn't show up.

Regards,

Padmanabhan

settu_periasamy
Master III
Master III

Hi,

Check this..

simenkg
Specialist
Specialist

How about doing it in the script:

when you load your fact-table:

Fact_t2:

Load

*,

Autonumber(Year(%DateKey)&'-'&Month(%DateKey), Product) as MonthCounterPerProduct,

resident Facts order by %DateKey asc;

You have to first load the facts from file and then load them resident, as you cannot change the order of the table in Qlik on the first reading from file. If the dates are ordered in the original file, then you can do the operation on the original load.

Then you can use

sum({<MonthCounterPerProduct={1}>} Sales)

tresesco
MVP
MVP

Which chart? Try combo chart.