Skip to main content
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: 
shiveshsingh
Master
Master

Slowly Changing dimension

I am having one Brand X which is associated with Store Dimension A

Now suppose, Brand X association with Store Dimension is changed to B today. I don't have any date column in DB

How to cope up with this using SCD concept so that historical data is not altered.

1 Solution

Accepted Solutions
sunny_talwar

Create qvds with date stamps so that although you don't have date in the main database, you can stamp them with date (pull date) when you store them into qvd

View solution in original post

8 Replies
sunny_talwar

Create qvds with date stamps so that although you don't have date in the main database, you can stamp them with date (pull date) when you store them into qvd

YoussefBelloum
Champion
Champion

Hi,

Maybe now you need to create a change_date_field to flag this and insert a date on every row until the next change..

cristian_av
Creator III
Creator III

When you get the data from the database, add a field with current date.

Something like this:

//(You need a script to create the StoredDate.qvd file for the first load)

Concatenate(StoredData) Load * from StoredDate.qvd

Load *

DimensionA,

today(0) as LastUpdate;

From Database;

//In case you need only the last update for each records, use this:

Load MaxString(DimensionA), Max(LastUpdate)

RESIDENT StoredData

GROUP BY DimensionA,LastUpdate;

Be careful that your date will only be loaded when you reload the qvw, so if you reload it every two days, you will have the data every two days and not the real change date.

shiveshsingh
Master
Master
Author

Please can you share sample code

shiveshsingh
Master
Master
Author

Please can you share sample code

sunny_talwar

Share some data

shiveshsingh
Master
Master
Author

Haha..:P

i tried and got it

Thanks bhai

sunny_talwar

Super