Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
krishna20
Specialist II
Specialist II

Unique Month and Year

Hi Folks,

I'm having grocery products like vegetables, Fruits, Dairy Items......My Table structure is PROD_ID, PROD_NAME, YEAR, MONTHLY wise sales, TOTAL SALES.

For every table, structure is the same.I applied cross table to achieve monthly sales. All tables having MonthYear. How can i achieve the unique Month Year for all tables.

If i select a month or year it should filter data accordingly for all the products.

Please find the attached sample data as well as sample app.

Please someone guide me to achieve this logic.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand
sunny_talwar

Alternatively, you can also add this at the end of the script:

FinalTable:

NoConcatenate

LOAD Veget_ID as ID,

    Category_ID,

    Veg_Prod_Name as Prod_Name,

    Vegetable_Sales as Sales,

  Veget_MonthYear as MonthYear,

    Veget_Value as Value

Resident Vegetables_Sales;

Concatenate (FinalTable)

LOAD Fruits_ID as ID,

    Category_ID,

    Fruit_Prod_Name as Prod_Name,

    Fruit_Sales as Sales,

  Fruits_MonthYear as MonthYear,

    Fruit_Value as Value

Resident Fruit_Sales;

Concatenate (FinalTable)

LOAD Dairy_ID as ID,

    Category_ID,

    Dairy_Name as Prod_Name,

    Dairy_Sales as Sales,

  Dairy_MonthYear as MonthYear,

    Dairy_Value as Value

Resident Dairy_Sales;

DROP Tables Vegetables_Sales, Fruit_Sales, Dairy_Sales;

krishna20
Specialist II
Specialist II
Author

Thank You Gysbert.

Absolute solution. what i'm looking for....

krishna20
Specialist II
Specialist II
Author

Thank You Sunny...

sunny_talwar

No problem my friend

krishna20
Specialist II
Specialist II
Author

Hi,

sunindia

Why it's loading only distinct values?? Please let me know the concept of script. Totals are coming as correctly. Please find the attached Jpg.

Grocery_Sample_Help.png

sunny_talwar

List box object is showing unique values, that doesn't mean it is loading unique values. Create a table box with ProdName, YearMonth and Value and you will see all values are still intact.

krishna20
Specialist II
Specialist II
Author

Thank you Sunny for your explanation and sorry for late reply..